<!DOCTYPE html>
<html>
<#if root?exists>
<head>
<title>WebDesign Admin - Home</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<!-- bootstrap -->
<link href="${root.path}/css/bootstrap/bootstrap.css" rel="stylesheet" />
<link href="${root.path}/css/bootstrap/bootstrap-responsive.css" rel="stylesheet" />
<link href="${root.path}/css/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet" />

<!-- libraries -->
<link href="${root.path}/css/lib/font-awesome.css" type="text/css" rel="stylesheet" />

<!-- global styles -->
<link rel="stylesheet" type="text/css" href="${root.path}/css/layout.css" />
<link rel="stylesheet" type="text/css" href="${root.path}/css/elements.css" />
<link rel="stylesheet" type="text/css" href="${root.path}/css/icons.css" />

<!-- this page specific styles -->
<link rel="stylesheet" href="${root.path}/css/compiled/tables.css" type="text/css" media="screen" />
<link rel="stylesheet" href="${root.path}/css/compiled/index.css" type="text/css" media="screen" />
<link rel="stylesheet" href="${root.path}/css/compiled/basicinfosetting.css" type="text/css" media="screen" />

<!--kindeditor-->
<link rel="stylesheet" href="${root.path}/themes/default/default.css"  type="text/css" />

<!-- open sans font -->
<link
	href='http://fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800'
	rel='stylesheet' type='text/css' />

<!-- lato font -->
<link
	href='http://fonts.useso.com/css?family=Lato:300,400,700,900,300italic,400italic,700italic,900italic'
	rel='stylesheet' type='text/css' />

<link rel="stylesheet" href="${root.path}/css/font-awesome.min.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<body>
	<!-- navbar -->
	<div class="navbar navbar-inverse">
		<div class="navbar-inner">
			<a class="brand" href="#">
				<img src="${root.path}/img/logo-login.png" />
			</a>
			<ul class="nav pull-right">
				<!--无序列表-->
				 <li>
                	<a href="${root.path}/admin/showTeachers">
                   	${root.username}
                	</a>
            	</li>
				<div class="copyrights"></div>

				<li class="hidden-phone">
                    <a href="#">修改密码</a>
                </li>

                <li class="hidden-phone">
                    <a href="${root.path}/common/logout">注销</a>
                </li>
			</ul>
		</div>
	</div>
	<!-- end navbar -->

	<!-- sidebar -->
	<div id="sidebar-nav">
		<ul id="dashboard-menu">
			<li>
				<a href="${root.path}/admin/showTeachers"> 
					<i class="icon-home"></i>
					<span>管理员主页</span>
				</a>
			</li>

			<li>
				<a class="dropdown-toggle" href="#"> 
					<i class="icon-asterisk"></i>
					<span>教师管理</span>
					<i class="icon-chevron-down"></i>
				</a>
				<ul class="submenu">
					<li><a href="${root.path}/admin/resetTeachersPwdShow">重置密码</a></li>
				</ul>
			</li>

			<li class="active">
				<div class="pointer">
					<div class="arrow"></div>
					<div class="arrow_border"></div>
				</div>
				<a class="dropdown-toggle" href="#"> 
					<i class="icon-edit"></i>
			 		<span>门户信息设置</span>
			 		<i class="icon-chevron-down"></i>
				</a>
				<ul class="submenu">
					<li><a href="${root.path}/admin/setBasicInfo">基本信息设置</a></li>
					<li><a href="${root.path}/admin/setDisplyShow">轮播展示</a></li>
				</ul>
			</li>

			<li>
				<a href="${root.path}/admin/showALLHomeworks">
				 	<i class="icon-list-alt "></i>
					<span>作业信息</span>
				</a>
			</li>
	</div>
	<!-- end sidebar -->


	<!-- main container -->
	<div class="content">
		<form action="${root.path}/aAdmin/submitAnnounce" method="post" id="form1">
		<div class="container-fluid">
			<!-- table sample -->
			<!-- the script for the toggle all checkboxes from header is located in js/theme.js -->
			<div class="table-products section">
				<div class="row-fluid">
					<table class="table">
						<tr>
							<td><label>标题:</label></td>
							<td><input name="title" id="title" class="span5" type="text" /></td>
						</tr>
						<tr>
							<td colspan="2">
								<input name="notice" type="radio" value="0" checked="checked"/> 教师公告
		                    	<input name="notice" type="radio" value="1" /> 学生公告
	                    	</td>
						</tr>
						<tr>
							<td><label>描述:</label></td>
							<td><textarea name="content" id="content">你好！</textarea></td>
						</tr>
	                    <tr>
							<td colspan="2" style="text-align:center;">
								<input type="button" class="btn btn-default mybtn" value="提交" id="btn"/>
	                    	</td>
						</tr>
                     </table>
				</div>
			</div>
		</div>
		</form>
	</div>
</body>

<script src="${root.path}/js/jquery-latest.js"></script>
<script src="${root.path}/js/bootstrap.min.js"></script>
<script src="${root.path}/js/theme.js"></script>

<!--kindeditor-->
<script src="${root.path}/js/kindeditor.js"></script>
<script src="${root.path}/js/zh_CN.js"></script> 

<script type="text/javascript">

/*kindeditor*/
	var editor;

	KindEditor.ready(function(K) {
		editor = K.create('textarea[name="content"]', {
			allowFileManager : true
		});
	});
	
	
	/*发布公告*/
	$("#btn").click(function(){
		var title = $("#title").val();
		var type = $('input[name="notice"]:checked').val();
		editor.sync(); 
		var content = $("#content").val();
	    $.ajax({
		    url:"${root.path}/aAdmin/submitAnnounce",
		    data:{title:title,type:type,content:content},
	        type:"post",
	        dataType:"json",
	        error:function(){
	        	alert("请求出错！");
	        },
	        success:function(responseResult){
	        	if(responseResult.flag){
	        		alert("提交成功！");
	        	}else{
	                alert("提交失败！");
	            }
	        }
	   });
	});
			
</script>

</#if>
</html>